<template>
  <div class="myheader">
     <section class="center">
       <slot></slot>
     </section>
     <span class="right" @click="btn">
        <slot name="right"></slot>
     </span>
  </div>
</template>
<script>
export default {
   setup(props,{emit}) { //ctx 指向的是向下文
      // console.log(ctx);
      const btn = () => {
         emit('rightClick');
      }
      return{
         btn
      }
   }
}
</script>
<script>
</script>
<style lang="scss" scoped>
.myheader{
   height: 50px;
   display: flex;
   align-items: center;
   background: #fff;
   text-align: center;
   .center{
      flex: 1;
   }
   .right{
      width: 80px;
   }
}
</style>